%%%-------------------------------------------------------------------
%%% @author mirahs(2892727493@qq.com)
%%% @doc
%%%     项目相关工具
%%% @end
%%%-------------------------------------------------------------------
-module(util).

-export([
    md5/1
    ,md5_caps/1
]).

-include("common.hrl").
-include("http.hrl").
-include("error.hrl").


%%%===================================================================
%%% API
%%%===================================================================

md5(S) ->
    list_to_binary([io_lib:format("~2.16.0b",[N]) || N <- binary_to_list(erlang:md5(S))]).

md5_caps(S) ->
    list_to_binary([io_lib:format("~2.16.0B",[N]) || N <- binary_to_list(erlang:md5(S))]).

